﻿#light
open AbstractExample
open AppliedExample

let abstractExample() =
    let implA = ConcreteImplementorA()
    let ab = RefinedAbstraction(implA)

    // Set implementation and call
    ab.Operation()

    // Change implemention and call
    ab.Implementor <- ConcreteImplementorB()
    ab.Operation()

let appliedExample() =
    // Set ConcreteImplementor
    let data = new CustomersData()
    
    // Create RefinedAbstraction
    let customers = new Customers("Chicago", data)



    // Exercise the bridge
    customers.Show()
    customers.Next()
    customers.Show()
    customers.Next()
    customers.Show()
    customers.New("Henry Velasquez")

    customers.ShowAll()

abstractExample()
appliedExample()
printfn "----------------"
System.Console.ReadKey(true) |> ignore
